Originally Posted by
fouzimedfouni
I changed to strcmp((a,b) == 0)
and still the samep
That is because you are still making the same mistake, except that now you made it twice. The type of a and b is int. strcmp is declared as:
Code:
int strcmp(const char *s1, const char *s2);
Clearly, int is not compatible with const char*. In this case, strcmp looks entirely unnecessary. You could have written:
Code:
#include <stdio.h>
int main(void) {
int a = 15;
int b = 20 ;
if (a == b) {
printf("Correct!");
} else {
printf("noooooooooooooo!");
}
getchar();
return 0;
}
Note that if you do want to call strcmp, you should #include <string.h>